home *** CD-ROM | disk | FTP | other *** search
/ Developer Helper 1: Phil & Dave's Excellent CD / Excellent CD HFS.raw / Moof / Goodies / HyperCard Goodies / HyperCard Dev. ToolKit / Serial & MacinTalk XCMDs / GetCreator.p < prev    next >
Text File  |  1987-07-04  |  1KB  |  59 lines

  1. {$R-}
  2.  
  3. (*
  4.     GetCreator -- map OSType to creator name
  5.  
  6.     pascal GetCreator.p
  7.     asm GetCreator.a
  8.     link -m ENTRYPOINT -o {BOOT}docs -rt XFCN=1 -sn Main=GetCreator ∂
  9.       GetCreator.p.o  GetCreator.a.o ∂
  10.       {MPW}Libraries:Interface.o 
  11.         {boot}hypercard
  12.  
  13.     
  14. *)
  15.  
  16. {$S GetCreator }     { Segment name must be the same as the command name. }
  17.  
  18. UNIT DummyUnit;
  19.  
  20. INTERFACE
  21.  
  22. USES MemTypes, QuickDraw, OSIntf, HyperXCmd;
  23.  
  24. PROCEDURE EntryPoint(paramPtr: XCmdPtr);
  25.     
  26. IMPLEMENTATION
  27.  
  28. TYPE Str31 = String[31];
  29.  
  30. PROCEDURE GetCreator(paramPtr: XCmdPtr);                             FORWARD;
  31. FUNCTION  ScanDeskTop(creator: OSType; VAR appVol: INTEGER; 
  32.                       VAR appDir: LongInt; VAR appName: Str255): BOOLEAN;            EXTERNAL;
  33.  
  34.   PROCEDURE EntryPoint(paramPtr: XCmdPtr);
  35.   BEGIN
  36.     GetCreator(paramPtr);
  37.   END;
  38.  
  39.   PROCEDURE GetCreator(paramPtr: XCmdPtr);
  40.   VAR creator: OSType;
  41.       appName: Str255;
  42.       appVol:  INTEGER;
  43.       appDir:  LongInt;
  44.   {$I XCmdGlue.inc }
  45.   BEGIN
  46.     WITH paramPtr^ DO
  47.       BEGIN
  48.         IF paramCount < 1 THEN EXIT(GetCreator);
  49.     BlockMove(params[1]^,@creator,4);
  50.         IF ScanDeskTop(creator,appVol,appDir,appName) 
  51.     THEN returnValue := PasToZero(appName);
  52.       END;
  53.   END;
  54.  
  55. END.
  56.  
  57.  
  58.  
  59.